package com.drg.center.utils;

import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;

import java.time.LocalDate;
import java.time.Month;
import java.util.List;

/**
 * @Author: zhangxilin
 * @Date: 2025/1/6
 */
public class BusinessDateUtil {

    public static List<String> getMonthList(Integer year){
        List<String> list = Lists.newArrayList();

        if (year == null || year < 1000 || year > 9999) {
            throw new IllegalArgumentException("Year must be a valid four-digit number.");
        }

        LocalDate now = LocalDate.now();
        for (Month month : Month.values()) {
//            if(year>= now.getYear() && month.getValue()> now.getMonthValue()){
//                continue;
//            }
            list.add(String.format("%d-%02d", year, month.getValue()));
        }

        return list;
    }

    public static void main(String[] args) {
        List<String> ms = getMonthList(2025);
        System.out.println(JSONObject.toJSONString(ms));
    }
}
